package com.fourth.controller.api;


import com.ljx.utils.OssUtil1;
import com.ljx.vo.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author xiaoZhu
 * @version 1.0
 * @date 2023/3/1 19:06
 */

/**
 * 图片上传
 */
@RestController
@RequestMapping("home/api/oss")
public class OssController {
    @RequestMapping("/upload")
    @ResponseBody
    public Result upload(MultipartFile file) throws Exception {
            String path = OssUtil1.ossUpload(file);
        return new Result(200,"上传成功",path);
    }
}
